﻿using System;
using System.Linq;
using Controllers;

namespace Web
{
    public partial class BirthdayBless : System.Web.UI.Page
    {
        protected Pagination Model;
        protected string photoName;
        protected void Page_Load(object sender, EventArgs e)
        {
            Model = new Pagination();
            Model.PageNumShown =6;
            Model.CurrentPage = 1;
            if (Request.QueryString["pageNum"] != null)
            {
                Model.CurrentPage = int.Parse(Request.QueryString["pageNum"]);
            }
            Model.NumPerPage =100;
            if (Request.QueryString["numPerPage"] != null)
            {
                Model.NumPerPage = int.Parse(Request.QueryString["numPerPage"]);
            }
            int empId = int.Parse(Request.QueryString["empId"]);
            EmpProfileController epc=new EmpProfileController();
            photoName = epc.GetPhotoName(empId);

            BirthdayController bc = new BirthdayController();
            int cnt;
            int start = (Model.CurrentPage - 1) * Model.NumPerPage;

            IQueryable<BirthdayBlessDTO> listData = bc.Find(empId,start, Model.NumPerPage, out cnt);
            Model.TotalCount = cnt;

            rptList.DataSource = listData;
            rptList.DataBind();
        }
    }
}